/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package projet_maths;

import java.util.LinkedList;
import java.util.List;
import java.util.Random;

/**
 *
 * @author JR
 */
public class Carte {
    List<Integer> ensemble;
    
    public int GetNbNum()
    {
        return ensemble.size();
    }
    
    public int GetPosOf(int value)
    {
        int tmp = -1;
        for (Integer i : ensemble)
        {
            if (i == value)
            {
                ensemble.indexOf(i);
            }
        }
        return tmp;
    }
    
    public boolean Equals(Carte c)
    {
        if (this.GetNbNum() != c.GetNbNum())
            return false;
        
        boolean areEq = true;
        for (int i = 0 ; i < GetNbNum() ; i++)
        {
            if (this.ensemble.toArray()[i] != c.ensemble.toArray()[i])
            {
                areEq = false;
            }
        }
        return areEq;
    }
    
    public Carte(int nbNumeros, int min, int max)
    {
        Random rn = new Random();
        ensemble = new LinkedList<>();
        for (int i = 0; i < nbNumeros ; i++)
        {
            ensemble.add(rn.nextInt(max-min)+min);
        }
    }
}
